package com.edu.schoolforum.controller;

import com.edu.schoolforum.test.Address;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tao
 * @date 2021/10/1 15:51
 */
@Controller
@RestController
@RequestMapping("/api")
public class TestController {
    @GetMapping("/test")
    public Object getMessage(){
        List<Address> list=new ArrayList<>();
        Address address1=new Address();
        address1.setDate("2016-05-03");
        address1.setName("王小虎");
        address1.setProvince("上海");
        address1.setCity("普陀区");
        address1.setAddress("上海市普陀区金沙江路1518弄");
        address1.setZip(200333);
        Address address2=new Address();
        address2.setDate("2016-05-04");
        address2.setName("王小虎");
        address2.setProvince("上海");
        address2.setCity("普陀区");
        address2.setAddress("上海市普陀区金沙江路1518弄");
        address2.setZip(200345);
        Address address3=new Address();
        address3.setDate("2016-05-03");
        address3.setName("王小虎");
        address3.setProvince("上海");
        address3.setCity("普陀区");
        address3.setAddress("上海市普陀区金沙江路1518弄");
        address3.setZip(200355);
        Address address4=new Address();
        address4.setDate("2016-05-03");
        address4.setName("王小虎");
        address4.setProvince("上海");
        address4.setCity("普陀区");
        address4.setAddress("上海市普陀区金沙江路1518弄");
        address4.setZip(200356);
        Address address5=new Address();
        address5.setDate("2016-05-03");
        address5.setName("王小虎");
        address5.setProvince("上海");
        address5.setCity("普陀区");
        address5.setAddress("上海市普陀区金沙江路1518弄");
        address5.setZip(200357);
        list.add(address1);
        list.add(address2);
        list.add(address3);
        list.add(address4);
        list.add(address5);
        return list;
    }
}
